package com.xframe.domain.e3sp.basedata;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xframe.domain.BaseModel;
import com.xframe.xdal.core.annotation.*;
import com.xframe.xdal.core.constant.AutoFillType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;

/**
 * @Description: 节号
 * @ClassName: com.xframe.domain.e3sp.basedata.Section
 * @Author: lmx
 * @CreateTime: 2024/01/02
 **/
@Data
@Accessors(chain=true)
@XTable(value = "p_t02_section", label = "节号")
@XSelectItem(keyName = "sectionId",codeName = "sectionNo",textName = "sectionNo")
@XBelongsTo(typeName = "com.xframe.domain.e3sp.basedata.Chapter",foreignKey = "chapterId", targetKey = "chapterId",as = "refChapter")
public class Section extends BaseModel {
    /**
     * 节号ID
     */
    @AutoFill(AutoFillType.Snowflake)
    @XColumn(name = "section_id", primaryKeyFlag = true,desc = "节号ID")
    private Long sectionId;

    /**
     * 章号ID
     */
    @XQueryCondition
    @XColumn(name = "chapter_id", desc = "章号ID")
    private Long chapterId;

    /**
     * 节号
     */
    @XQueryCondition
    @XColumn(name = "section_no", uniqueFlag = true,desc = "节号",length = 200)
    @XGridTableRef
    private String sectionNo;

    /**
     * 中文名称
     */
    @XQueryCondition
    @XGridTableRef
    @XColumn(name = "name_cn",desc = "中文名称",length = 200)
    private String nameCn;

    /**
     * 英文名称
     */
    @XGridTableRef
    @XColumn(name = "name_en",desc = "英文名称",length = 200,nullFlag = true)
    private String nameEn;

    /**
     * 修改开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @XColumn(name = "modification_start_time",desc = "修改开始时间")
    private Date modificationStartTime;

    /**
     * 修改结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @XColumn(name = "modification_end_time",desc = "修改结束时间")
    private Date modificationEndTime;



    /**
     * 备注
     */
    @XColumn(name = "remark",desc = "备注",length = 500,nullFlag = true)
    private String remark;

    /**
     * 所属章节
     */
    private Chapter refChapter;
}
